package com.dayuanit.dy16.ebook.ebookweb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class PageController extends BaseController {

    @RequestMapping("/")
    public String index() {
        return "index";
    }

    @RequestMapping("/toNavPage")
    public String toNavPage() {
        return "navCommodity";
    }

    @RequestMapping("/toCommondity/{commoId}")
    public String toCommondity(@PathVariable("commoId") long commoId, HttpServletRequest request) {
        request.setAttribute("commodityId", commoId);
        return "commodity";
    }

    @RequestMapping("/cart/toCart")
    public String toCart() {
        return "cart";
    }

    @RequestMapping("/order/toSettlement")
    public String toSettlement() {
        return "settlement";
    }

    @RequestMapping("/order/toMyOrder")
    public String toMyOrder() {
        return "myOrder";
    }

}
